﻿/*********************弘石项目三组************************
*  功能描述：运营管理业务逻辑层
*  作者：周泽旭
*  时间：2021-12-10
*  修改人：周泽旭
*  修改时间：2021-12-10
*********************弘石项目三组************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hong.IRepository;
using Hong.Model.SysDomain.Model_ContractManagement;
using Hong.Model.SysDomain.Model_CustomerManagement;
using Hong.Model.SysDomain.Model_OperationManagement;
using Hong.Model.SysDomain.Model_SystemSettings;

namespace Hong.Business.Business_OperationManagement
{
    public class OperationBusiness
    {
        #region 构造器注入
        private readonly IOperationRepository operation;
        public OperationBusiness(IOperationRepository _operation)
        {
            operation = _operation;
        }
        #endregion

        #region 运营管理

        #region 项目立项添加
        public int Add(Project p)
        {
            return operation.Add(p);

        }
        #endregion

        #region 项目列表（分页显示、多条件查询）
        public Page ShowProject(int pageindex , int pagesize , string ProjectName = "", string ProjectConId = "")
        {
            var list = operation.ShowProject(pageindex, pagesize, ProjectName, ProjectConId);
            return list;
        }
        #endregion

        #region 项目关联合同（分页显示、多条件查询）
        public Page GetConPro(int pageindex, int pagesize, string ProjectName = "",string ProjectConId = "")
        {
            var list = operation.GetConPro(pageindex,pagesize,ProjectName, ProjectConId);
            return list;
        }
        #endregion

        #region 获取甲方联系人
        public List<Person> ShowReponsble()
        {
            var list = operation.ShowReponsble();
            return list;
        }
        #endregion

        #region 获取合同信息
        public List<ContractInfo> SelCon(string ContractName = "")
        {
            var list = operation.SelCon(ContractName);
            return list;
        }
        #endregion

        #region 获取部门信息
        public List<Department> GetDept()
        {
            var list = operation.GetDept();
            return list;
        }
        #endregion

        #region 项目列表反填
        public Project FindPro(string ProjectId)
        {
            var list = operation.FindPro(ProjectId);
            return list;
        }
        #endregion

        #region 项目列表修改
        public int UptPro(Project p)
        {
            var list = operation.UptPro(p);
            return list;
        }
        #endregion

        public List<Project> GetPro()
        {
            var list = operation.GetPro();
            return list;
        }

        /// <summary>
        /// 项目关联合同导出
        /// </summary>
        /// <returns></returns>
        public List<dynamic> GetProExcel()
        {
            var list = operation.GetProExcel();
            return list;
        }


        public int AddCon(int pid, int cid)
        {
            var list = operation.AddCon(pid, cid);
            return list;
        }

        #region 获取项目进度信息
        public Page GetProgress(int pageindex, int pagesize, string ProjectName = "", string ProjectDeptId = "")
        {
            var list = operation.GetProgress(pageindex, pagesize, ProjectName, ProjectDeptId);
            return list;
        }
        #endregion

        #region 获取项目进度统计导出
        public List<dynamic> GetGrassExcel()
        {
            var list = operation.GetGrassExcel();
            return list;
        }
        #endregion

        public List<ProjectType> ShowCountProject(string DName)
        {
            var list = operation.ShowCountProject(DName);
            return list;
        }


        #endregion
    }
}
